#include <QApplication>
#include "board.h"
#include "SingleAI.h"
#include "MaxMinAI.h"
#include "NegaMaxAI.h"
#include "AlphaBetaAI.h"
#include "netgame.h"
#include "choosedlg.h"
#include "mainwindow.h"

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

//    Board board;
//    SingleAI board;
//    board.show();

//    NetGame server(true);
//    server.show();
//    NetGame socket(false);
//    socket.show();

    ChooseDlg dlg;

//    if(dlg.exec() != QDialog::Accepted)
//        return 0;

    dlg.exec();

//    if (0 == dlg.selected) {
//        SingleAI *ai = new SingleAI;
//        ai->setAttribute(Qt::WA_DeleteOnClose);
//        ai->show();
//    } else if (1 == dlg.selected) {
//        MaxMinAI *ai = new MaxMinAI;
//        ai->setAttribute(Qt::WA_DeleteOnClose);
//        ai->show();
//    } else if (2 == dlg.selected) {
//        NegaMaxAI *ai = new NegaMaxAI;
//        ai->setAttribute(Qt::WA_DeleteOnClose);
//        ai->show();
//    } else if (3 == dlg.selected) {
//        AlphaBetaAI *ai = new AlphaBetaAI;
//        ai->setAttribute(Qt::WA_DeleteOnClose);
//        ai->show();
//    } else if (4 == dlg.selected) {
//        Board *board = new Board;
//        board->setAttribute(Qt::WA_DeleteOnClose);
//        board->show();
//    } else if (5 == dlg.selected) {
//        NetGame *server = new NetGame(true);
//        server->setAttribute(Qt::WA_DeleteOnClose);
//        server->show();
//    } else if (6 == dlg.selected) {
//        NetGame *socket = new NetGame(false);
//        socket->setAttribute(Qt::WA_DeleteOnClose);
//        socket->show();
//    }

    MainWindow mainWindow(dlg.selected);
    mainWindow.resize(500, 450);
    mainWindow.setWindowTitle("010 Chess");
    mainWindow.show();
    return a.exec();
}

